package com.maycurobj.view;

import lombok.Getter;
import lombok.Setter;

/**
 * 开票公司 转换
 */
public enum LegalEntityBizEnum {

    ONE("浙江博圣生物技术股份有限公司","ELC21102113QULS74"),
    TWO("杭州杰毅麦特医疗器械有限公司","ELC2111041NL9Y1A8"),
    THREE("杭州博圣医学检验实验室有限公司","ELC2111041NL9Y2V4"),
    FOUR("杭州贝安云科技有限公司","ELC2111041NL9WXS0"),
    FIVE("宁波贝生医疗器械有限公司","ELC2111041NL9X79C"),
    SIX("杭州博圣云鼎冷链物流有限公司","ELC2111041NL9XF5S"),
    EIGHT("浙江博圣生物技术股份有限公司工会委员会", "ELC21120612CKWXZ4"),
    NINE("浙江博圣公益基金会","ELC2112131IREWS1S"),
    TEN("上海龙幸医疗设备有限公司","ELC2207191LUJRABK")
    ;

    @Setter
    @Getter
    private String name;
    @Setter
    @Getter
    private String code;

    LegalEntityBizEnum(String name, String code) {
        this.name = name;
        this.code = code;
    }

    /**
     * code to name
     * @param s
     * @return
     */
    public static String convToName(String s) {
        if(s==null) {
            return null;
        }
        for(LegalEntityBizEnum biz: LegalEntityBizEnum.values()){
            if (biz.getCode().equals(s)) {
                return biz.getName();
            }
        }
        return null;
    }

    /**
     * name to code
     */
    public static String convToCode(String s){
        if (s == null) {
            return null;
        }
        for (LegalEntityBizEnum biz : LegalEntityBizEnum.values()) {
            if (biz.getName().equals(s)) {
                return biz.getCode();
            }
        }
        return null;
    }
}
